import java.util.Scanner;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Clerk extends User {
    public Clerk(String id, String username, String password, String phone) {
        super(id, username, password, phone, "clerk");
    }
    
    public void showMovies() {
        Movie.listAllMovies();
    }
    
    public void showSchedules() {
        Schedule.listAllSchedules();
    }
    
    public void showSeats(Scanner scanner) {
        Schedule.queryScheduleSeats(scanner);
    }
    
    public void sellTicket(Scanner scanner) {
        // 记录售票日志
        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        LogEntry.addLog(new LogEntry(time, "售票", this.getUsername(), "开始售票操作"));
        
        Ticket.sellTicket(scanner);
    }
    
    public void refundTicket(Scanner scanner) {
        // 记录退票日志
        String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        LogEntry.addLog(new LogEntry(time, "退票", this.getUsername(), "开始退票操作"));
        
        Ticket.refundTicket(scanner);
    }
} 